/*
 * @Author: master
 * @Date: 2022-04-08 13:21:05
 * @LastEditTime: 2022-04-12 16:09:00
 * @Description: 文件输出
 */
export default function output(viteConfig) {
  const defaultConfig = {
    chunkFileNames: 'js/[name]-[hash].js',
    entryFileNames: 'js/[name]-[hash].js',
    assetFileNames: '[ext]/[name].[hash].[ext]',
    manualChunks: {
      vue: ['vue', 'vue-router', 'pinia', '@vueuse/core', 'vue-i18n'],
    },
  };
  // 移动端
  if (viteConfig?.application === 'mobile') {
    defaultConfig.manualChunks.vant = ['vant'];
  } else {
    defaultConfig.manualChunks.arco = ['@arco-design/web-vue'];
  }
  return defaultConfig;
}
